package ad_exercise_4.controller;

import java.io.IOException;
import java.io.InputStream;

import ad_exercise_4.model.LZWTree;

public class LZWUtil {
	public static void compress(InputStream input) throws IOException {
		LZWTree lzwTree = new LZWTree();
		int next;
		do {
			next = input.read();
			if (next != -1) {
				int result = lzwTree.findNextOrAdd(next);
				if (result != -1) {
					// System.out.println(result);
				}
			}
		} while (next != -1);
		// System.out.println(lzwTree.getCurrentCode());
	}
}
